#!/bin/sh
# csrc/makefavorites
# 
# Part of the CCNx distribution.
#
# Copyright (C) 2009 Palo Alto Research Center, Inc.
#
# This work is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 2 as published by the
# Free Software Foundation.
# This work is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.
#
# Set up a FAVORITES directory with links to sources
# for a better experience with source browsers (e.g. Xcode Organizer)
mkdir -p FAVORITES/0
mkdir -p FAVORITES/1
find FAVORITES -type l \( -name \*.c -o -name \*.h \) -exec rm '{}' ';'
while read i; do
  b=`basename "$i"`
  case "${i:--}" in
    *contrib/*) ;;
    *.h) ln -s ../../"$i" FAVORITES/0/"$b";;
    *.c) ln -s ../../"$i" FAVORITES/1/"$b";;
  esac
done < MANIFEST
